home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / basic / mildred / mildred.lha / lha / ILBMviewer.lha / Prefs.ascii < prev    next >
Text File  |  1999-03-07  |  5KB  |  141 lines

  1.  
  2. ;Preferences
  3.  
  4. PrefDisplayID.l=$0      ; Default (unspecified, as it may possibly retarget if they have gfx card)
  5. ;PrefDisplayID.l=$40120000 ; Cybervision Lores 320x240 ?Hz
  6. ;PrefDisplayID.l=$21000 ; AGA Lores PAL 320x256 non-laced single-scan 50Hz
  7. ;PrefDisplayID.l=$A1000 ; AGA Lores DoublePAL 384x275 non-laced double-scan 48Hz
  8. ;PrefDisplayID.l=$89000 ; AGA Lores Super72 384x290 non-laced single-scan 71Hz
  9. ;PrefDisplayID.l=$11000 ; AGA Lores NTSC 320x200 non-laced single-scan 60Hz
  10. ;PrefDisplayID.l=$39000 ; AGA Lores Multiscan 320x240 double-scan 58Hz
  11. ;PrefDisplayID.l=$59000 ; AGA Lores HighGFX 512x250 non-laced single-scan 54Hz
  12. ;PrefDisplayID.l=$69000 ; AGA Lores Euro72 320x200 non-laced double-scan 69Hz
  13. ;PrefDisplayID.l=$91000 ; AGA Lores DoubleNTSC 384x227 non-laced double-scan 58Hz
  14. ;PrefDisplayID.l=$29004 ; AGA PAL 640x400 Hires laced single-scan 50Hz
  15. ;PrefDisplayID.l=$19004 ; AGA NTSC 640x400 Hires laced single-scan 60Hz
  16. ;PrefDisplayID.l=$39024 ; AGA Multiscan 640x400 Hires non-laced single-scan 58Hz
  17. ;PrefDisplayID.l=$69024 ; AGA Euro72 640x400 Hires non-laced single-scan 69Hz
  18. ;PrefDisplayID.l=$A9004 ; AGA DoublePAL 640x400 Hires non-laced double-scan 48Hz
  19. ;PrefDisplayID.l=$99004 ; AGA DoubleNTSC 640x400 Hires non-laced double-scan 58Hz
  20. PrefDisplayWidth.w=320
  21. PrefDisplayHeight.w=240
  22. PrefDisplayBuffering.b=2 ; 1..3
  23. ;If Joyb(0)=0 AND Joyb(1)=0 Then Goto PrefsSkip
  24.  
  25. #DTAG_DISP=$80000000
  26. #DTAG_DIMS=$80001000
  27. #DTAG_MNTR=$80002000
  28. #DTAG_NAME=$80003000
  29.  
  30. NEWTYPE.SMode
  31.   DID.l
  32.   DWidth.l
  33.   DHeight.l
  34.   DDepth.w
  35.   DType.w
  36. End NEWTYPE
  37.  
  38. DEFTYPE.Hook myhook ; The hook for ASL tag as &myhook
  39. myhook\h_Entry=?hook
  40. MOVE.l a5,globalbase
  41. funcret.l=0
  42.  
  43. Dim SMRtags.TagItem(17)
  44. SMRtags(0)\ti_Tag=#ASLSM_InitialLeftEdge,160
  45. SMRtags(1)\ti_Tag=#ASLSM_InitialTopEdge,0
  46. SMRtags(2)\ti_Tag=#ASLSM_InitialWidth,300
  47. SMRtags(3)\ti_Tag=#ASLSM_InitialHeight,600
  48. SMRtags(4)\ti_Tag=#ASLSM_InitialDisplayID,$21000
  49. SMRtags(5)\ti_Tag=#ASLSM_InitialDisplayDepth,8
  50. SMRtags(6)\ti_Tag=#ASLSM_InitialDisplayWidth,PrefDisplayWidth
  51. SMRtags(7)\ti_Tag=#ASLSM_InitialDisplayHeight,PrefDisplayHeight
  52. SMRtags(8)\ti_Tag=#ASLSM_InitialOverscanType,1
  53. SMRtags(9)\ti_Tag=#ASLSM_InitialInfoOpened,1
  54. SMRtags(10)\ti_Tag=#ASLSM_InitialInfoLeftEdge,350
  55. SMRtags(11)\ti_Tag=#ASLSM_InitialInfoTopEdge,50
  56. SMRtags(12)\ti_Tag=#ASLSM_DoDepth,0
  57. SMRtags(13)\ti_Tag=#ASLSM_DoOverscanType,1
  58. SMRtags(14)\ti_Tag=#ASLSM_DoWidth,1
  59. SMRtags(15)\ti_Tag=#ASLSM_DoHeight,1
  60. SMRtags(16)\ti_Tag=#ASLSM_FilterFunc,&myhook
  61. SMRtags(17)\ti_Tag=#TAG_DONE,0
  62.  
  63. *sreq.SMode=0
  64. *sreq=AllocAslRequest_(2,&SMRtags(0)\ti_Tag)
  65. ok.b=AslRequest_(*sreq,&SMRtags(0)\ti_Tag)
  66.  
  67. If ok<>0
  68.   PrefDisplayID.l=*sreq\DID
  69.   PrefDisplayWidth.w=*sreq\DWidth
  70.   PrefDisplayHeight.w=*sreq\DHeight
  71. EndIf
  72. If (*sreq) Then FreeAslRequest_(*sreq)
  73.  
  74. Goto PrefsSkip
  75.  
  76. ;*************************************************************************
  77. ; This is the statement that the hook will call.  Put the label before
  78. ; the statement you want to jump to.
  79. Runerrsoff
  80. .hook_jump:
  81. Statement hook{*dahook.Hook, modeID.l, *smr.ScreenModeRequester}
  82.   ; We're inside the hook, and supposedly we should be able to do whatever
  83.   ; we want.
  84.   ; Filter modeID's here
  85.   SHARED funcret.l
  86.   DEFTYPE.DisplayInfo DisInfoBuf
  87.   DEFTYPE.DimensionInfo DimInfoBuf
  88.   DEFTYPE.MonitorInfo MonInfoBuf
  89.   DEFTYPE.NameInfo NamInfoBuf
  90.   ;Refer to Includes/Graphics/DisplayInfo.h or view newtypes
  91.   IDhandle.l=FindDisplayInfo_(modeID)
  92.   GetDisplayInfoData_ IDhandle,&DisInfoBuf,SizeOf.DisplayInfo,#DTAG_DISP,0
  93.   GetDisplayInfoData_ IDhandle,&DimInfoBuf,SizeOf.DimensionInfo,#DTAG_DIMS,0
  94.   GetDisplayInfoData_ IDhandle,&MonInfoBuf,SizeOf.MonitorInfo,#DTAG_MNTR,0
  95.   GetDisplayInfoData_ IDhandle,&NamInfoBuf,SizeOf.NameInfo,#DTAG_NAME,0
  96.   ;Do tests. True=Mode is valid, False=mode is invalid.
  97.   If DimInfoBuf\MaxDepth<>8
  98.     ;No true-colour modes, only 8-bit
  99.     funcret=False
  100.   Else
  101.     funcret=True
  102.   EndIf
  103. End Statement
  104. ;*************************************************************************
  105.  
  106.  
  107. ;*************************************************************************
  108. ; Hook
  109. Macro goto_hook
  110.   JSR `1+6
  111. End Macro
  112.  
  113. globalbase: Dc.l 0
  114.  
  115. hook: ;This hook is called by the filter hook callback from screenmode requester, per item
  116. ; Store registers
  117. MOVEM.l   d1-d7/a0-a6,-(a7) ; Not d0!
  118.  
  119. ; Put parameters into dregs ready for a statement
  120. MOVE.l    a0,d0
  121. MOVE.l    a1,d1
  122. MOVE.l    a2,d2
  123.  
  124. ; Get global variable base
  125. MOVE.l    globalbase,a5
  126.  
  127. ; Goto hook statement
  128. !goto_hook{hook_jump}
  129.  
  130. GetReg d0,funcret ; return accept/discard
  131.  
  132. ; Restore registers
  133. MOVEM.l   (a7)+,d1-d7/a0-a6 ; Not d0!
  134.  
  135. RTS
  136.  
  137. Runerrson
  138. PrefsSkip
  139. PrefDisplayHeight AND $FFFE ; Not odd, otherwise interlaced display wont do all lines
  140.  
  141.